package com.googlecode.dgwt.client.dojox.grid.base;

public interface CellDefinicion {

	/**
	 * The text to use in the header of the grid for this cell.
	 * 
	 * @return
	 */
	public String getName();

	/**
	 * This function will be called when a cell requests data
	 * 
	 * @param rowIndex
	 * @return Returns the unformatted data for the cell
	 */
	public Object get(int rowIndex);

	/**
	 * If "get" is not specified, this is used as the data for the cell.
	 * 
	 * @return
	 */
	public Object getValue();

	/**
	 * If "get" and "getValue" returns an null value, this is used as the data
	 * for the cell. "formatter" is not run on this if "get" returns an null
	 * value.
	 * 
	 * @return
	 */
	public Object getDefaultValue();

	/**
	 * This function will be called after the cell has its data but before it
	 * passes it back to the grid to render. Returns the formatted version of
	 * the cell's data
	 * 
	 * @param data
	 * @param rowIndex
	 * @return
	 */
	public String formatter(Object data, int rowIndex);

	/**
	 * Whether this cell should be editable or not.
	 * 
	 * @return
	 */
	public boolean isEditable();

	/**
	 * If true, the cell will not be displayed.
	 * 
	 * @return
	 */
	public boolean isHidden();

	/**
	 * If true, the cell will not be able to be resized.
	 * 
	 * @return
	 */
	public boolean isNoReSize();

	/**
	 * A CSS size. If it's an Integer, the width will be in em's.
	 * 
	 * @return
	 */
	public String getWidth();

	/**
	 * How many columns to span this cell. Will not work in the first sub-row of
	 * cells.
	 * 
	 * @return
	 */
	public int getColSpan();

	/**
	 * How many sub-rows to span this cell.
	 * 
	 * @return
	 */
	public int getRowSpan();

	/**
	 * A String Array of styles to apply to both the header cell and main grid
	 * cells
	 * 
	 * @return
	 */
	public String[] getStyles();

	/**
	 * A String Array of styles to apply to just the header cell.
	 * 
	 * @return
	 */
	public String[] getHeaderStyles();

	/**
	 * A String Array of styles to apply to just the main grid cells.
	 * 
	 * @return
	 */
	public String[] getCellStyles();

	/**
	 * A space separated list of classes to apply to both the header cell and
	 * the main grid cells.
	 * 
	 * @return
	 */
	public String[] getClasses();

	/**
	 * A space separated list of classes to apply to just the header cell.
	 * 
	 * @return
	 */
	public String[] getHeaderClasses();

	/**
	 * A space separated list of classes to apply to just the main grid cells.
	 * 
	 * @return
	 */
	public String[] getCellClasses();

	/**
	 * A space separated string of attribute='value' pairs to add to the header
	 * cell element and main grid cell elements.
	 * 
	 * @return
	 */
	public String[] getAttrs();
}
